<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>找出符合条件的数</title>
</head>
<body style="text-align:center;">
    <h3>找出1000〜9999之间能够被17和13同时整除的整数的个数及累加和</h3>
 <div align="center">
    <script >
        function num(){
            var k = 0;
            var sum = 0;
            for(i=1000;i<9999;i++){
                if (i%17==0 && i%13==0){
                    k++;
                    sum+=i;
                    document.write(i+" ");
                    if(k%10==0){
                        document.write('<br>');
                    }
                } 
            }
            document.write('<br>'+"总共" + k + "个");
        }num();
    </script>
</div>
</body>
</html>